//
//  GeneralModelDefine.h
//  CToolBox
//
//  Created by oyf on 16/7/24.
//  Copyright © 2016年 oyf. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JSONModel.h"



@interface PageInfoModel: JSONModel

@property (nonatomic, assign) int PageIndex;
@property (nonatomic, assign) int PageSize;
@property (nonatomic, assign) int PageCount;
@property (nonatomic, assign) int TotalCount;

@end


@protocol MultiMessageModel <NSObject>
@end

@interface MultiMessageModel : JSONModel

@property (nonatomic, copy) NSString *key;
@property (nonatomic, copy) NSString *message;

@end



@interface ErrorModel : JSONModel

@property (nonatomic, assign) int errorNo;
@property (nonatomic, assign) BOOL hasError;
@property (nonatomic, assign) BOOL isMultiError;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, strong) NSArray<MultiMessageModel> *multiMessage;

@end



@interface InfoModel : JSONModel

@property (nonatomic, assign) int dataType;
@property (nonatomic, strong) PageInfoModel *pageInfo;

@end



@interface OrderModel : JSONModel

@property (nonatomic, assign) int Index;

@end




@interface SystemModel : JSONModel

@property (nonatomic, strong) NSDate *GenerateTime;
//@property (nonatomic, assign) BOOL DeleteFlag;
//@property (nonatomic, strong) NSDate *DeleteTime;

@end






//网络数据成功回调block
typedef void (^succeedBlock)(id respondObject);
//失败回调
typedef void (^failureBlock)(id respondObject);

/** 缓存是否过期block */
typedef void(^cacheCompleteBlock)(BOOL isExpired,id object);

//下载
typedef void (^downloadSuccessBlock)( id downloadResponse);
typedef void (^downloadProgressBlock)(CGFloat progressValue);


@protocol CTVisitorDelegate <NSObject>

@optional

//请求成功结束
- (void)visitorRequestEnd;
//错误信息(请求成功)
- (void)visitorExistErrorWithNo: (int)ErrorNo Message:(NSString *)ErrorMessage;
//请求失败
- (void)visitorRequestFailure;

@end


@protocol CTOperatorDelegate <NSObject>

@optional

//请求成功结束
- (void)operatorRequestEnd;
//错误信息
- (void)operatorExistErrorWithNo:(int)ErrorNo Message:(NSString *)ErrorMessage;
//请求失败
- (void)operatorRequestFailure;

@end


@protocol CTOperatorManagerDelegate <NSObject>

@optional

//请求成功结束
- (void)operatorManagerRequestEnd;
//错误信息
- (void)operatorManagerExistErrorWithNo: (int)ErrorNo Message:(NSString *)ErrorMessage;
//请求失败
- (void)operatorManagerRequestFailure;

@end


